package cn.itcast.bos.quartz;

import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.dao.take_delivery.PromotionDao;
import cn.itcast.bos.service.take_delivery.PromotionService;
public class PromotionJob implements Job {

	
	@Autowired
	private PromotionService  promotionService;
	@Override
	public void execute(JobExecutionContext arg0) throws JobExecutionException {
		
		//活动过期执行 当前时间大于结束时间说明活动已经过期,把状态码改为2
		System.out.println("活动过期程序执行");
		promotionService.updateDate(new Date());
	}

}
